<template>
    <view>
        <u-steps current="0" direction="column">
            <u-steps-item
                v-for="(item, index) in browseRecords"
                :title="'查看了 -' + (item.giName || item.gbPage) + ' - 浏览时长： ' + parseInt(item.gbTime / 1000) + '秒'"
                :desc="UTCTimeToLocal(item.gbInti)"
            >
            </u-steps-item>
        </u-steps>
    </view>
</template>

<script>
import { getMyCustomerBrowse } from "../../utils/api";
import { mapGetters } from "vuex";

export default {
    data() {
        return {
            browseRecords: [],
            ciUuid: "",
        };
    },

    computed: {
        ...mapGetters({
            activity: "activityInfo/activity",
            staffInfo: "personInfo/staffInfo",
        }),
    },

    onLoad(params) {
        this.ciUuid = params.ciUuid;
        if (params.ciUuid) {
            this.loadCustBrowse(this.ciUuid, this.activity.gpUuid, this.staffInfo.orUuid);
        }
    },

    watch: {},

    methods: {
        async loadCustBrowse(ciUuid, gpUuid, gbSsid) {
            let res = await getMyCustomerBrowse({ ciUuid, gbSsid, gpUuid });
            if (res) this.browseRecords = res || [];
        },
    },
};
</script>

<style lang="scss" scoped></style>
